package com.jb.platform.core.pojo.result;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.Getter;

import java.io.Serializable;
import java.util.Objects;


@Data
public class RespResult<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer code;

    private String msg;

    private long time;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private T data;

    private RespResult() {
        this.time = System.currentTimeMillis();
    }


    private RespResult(Integer code, T data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
        this.time = System.currentTimeMillis();
    }
    private RespResult(Integer code,String msg) {
        this.code = code;
        this.data = null;
        this.msg = msg;
        this.time = System.currentTimeMillis();
    }

    public RespResult(T res) {
    }
}
